package com.example.redisdemo.config;

import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author 杨佳万
 */
@Configuration
@EnableTransactionManagement
@MapperScan("com.mp.javamp.mapper")
public class MybatisPlus_Config {

    /**
     * 配置分页对象
     * @return
     */

    @Bean
    public PaginationInterceptor paginationInterceptor(){
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
         return  paginationInterceptor;
    }


    /**
     * 逻辑删除组件
     * @return
     */
    @Bean
    public ISqlInjector iSqlInjector(){

            return  new LogicSqlInjector();
    }

}
